/*
 * Copyright (c) 2023, 2023,yzc.cn All rights reserved.
 *
 */
package cn.yzc.controller;

import cn.yzc.group.Save;
import cn.yzc.pojo.OaClockSet;
import cn.yzc.pojo.Result;
import cn.yzc.service.OaClockSetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>Project: SpringMVCPro - OaClockSetController</p>
 * <p>Powered by yzc On 2023-11-06 14:29:02</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@RestController
@RequestMapping("/OaClockSet")
public class OaClockSetController extends BaseController{
    @Autowired
    OaClockSetService oaClockSetService;

    @PostMapping("/insert")
    public Result InsertSet(@Validated(value = {Save.class}) @RequestBody OaClockSet oaClockSet , BindingResult result){
        validator(result);
        int rs = oaClockSetService.insertSet(oaClockSet);
        if (rs == 0)
            return Result.error("保存失败");
        return Result.success(oaClockSet);
    }
}
